from django.db import models

# Create your models here.
# 用户账号
class UserAccountNumber(models.Model):
    account = models.CharField(verbose_name="账号",max_length=13,unique=True)
    password_md5 = models.CharField(verbose_name="加密密码",max_length=32)
    exist = models.BooleanField(verbose_name="是否激活",default=False)

    def __str__(self):
        return "账号：" + self.account

# 密码
class UserPassword(models.Model):
    password = models.CharField(verbose_name="密码", max_length=16)
    password_md5 = models.CharField(verbose_name="加密密码", max_length=32)

    uid = models.OneToOneField(UserAccountNumber, on_delete=models.CASCADE)



# 用户信息
class UserInformation(models.Model):
    user_name = models.CharField(verbose_name="用户名", max_length=64)
    grade = models.IntegerField(verbose_name="信用分", default=5)

    uid = models.OneToOneField(UserAccountNumber, on_delete=models.CASCADE)




